import request from '@/utils/request'

// 查询设备列表
export function listEquipment(query) {
  return request({
    url: '/equipment/list',
    method: 'post',
    data: query
  })
}

// 查询设备详细
export function getEquipment(id) {
  return request({
    url: '/equipment/' + id,
    method: 'get'
  })
}

// 新增设备
export function addEquipment(data) {
  return request({
    url: '/equipment',
    method: 'post',
    data: data
  })
}

// 修改设备
export function updateEquipment(data) {
  return request({
    url: '/equipment',
    method: 'put',
    data: data
  })
}

// 删除设备
export function delEquipment(id) {
  return request({
    url: '/equipment/' + id,
    method: 'delete'
  })
}

// 导出设备
export function exportEquipment(query) {
  return request({
    url: '/equipment/export',
    method: 'get',
    params: query
  })
}

// 下载配线架导入模板
export function importTemplate() {
  return request({
    url: '/equipment/importTemplate',
    method: 'get'
  })
}

// 查询附加条件

export function queryEQ(key) {
  return request({
    url: '/equipment/query?equipmentIdKey='+key,
    method: 'get'
  })
}
export function editQuery(data) {
  return request({
    url: '/equipment/editQuery',
    method: 'get',
    params:data
  })
}

//新增和修改设备

export function saveOrUpdate(data) {
  return request({
    url: '/equipment/saveOrUpdate',
    method: 'post',
    data:data
  })
}
// 获取设备列表
export function equipmentDictList() {
  return request({
    url: '/equipment/dictList',
    method: 'get'
  })
}